package kr.co.doriclassic.pro21;
class MyException extends NegativeArraySizeException{
	public MyException(String message) {
		super(message);
	}	
}
public class MyExceptionTest{
	public static void checkNegative(int number) throws MyException{
		if(number < 0){
			throw (new MyException("음수는 안됩니다."));
		}
	}	
	public static void main(String[] args) {
		try {
			checkNegative(1);
			checkNegative(-1);
		} catch (MyException e) {
			e.printStackTrace();
		}
		
	}
}

